package com.viethp.mt.objects;

import org.ksoap2.serialization.SoapObject;

public class OActivity {

	private static final String XML_ITEM_ID = "id";
	private static final String XML_ACTIVITY_ID = "activity_id";
	private static final String XML_ITEM_TITLE = "title";
	private static final String XML_ACTIVITY_PRICE = "price";
	private static final String XML_YOUR_PRICE = "your";
	private static final String XML_EXPIRED = "expired";
	private static final String XML_MAX_BUDGET = "max_budget";
	private static final String XML_TOTAL_BIDDER = "total_bidder";
	private static final String XML_DESCRIPTION = "description";
	private static final String XML_IMG_LINK = "imgLink";
	private static final String XML_CATEGORY_ID = "category_id";
	private static final String XML_STATUS = "status";

	private int item_id, activity_id, category_id, status;
	private String item_title, imgLink, description;
	private int expired, total_bidder, price, your;
	private String max_budget;

	public OActivity(int id, String item_title, int expired, int price,
			int your, String max_budget, int total_bidder) {
		this.item_id = id;
		this.item_title = item_title;
		this.expired = expired;
		this.total_bidder = total_bidder;
		this.max_budget = max_budget;
		this.price = price;
		this.your = your;
	}

	public OActivity(SoapObject OActivity) {
		if (OActivity != null && OActivity.hasProperty(XML_ITEM_ID)) {
			this.item_id = Integer.parseInt(OActivity.getProperty(XML_ITEM_ID)
					.toString());
			this.activity_id = Integer.parseInt(OActivity.getProperty(
					XML_ACTIVITY_ID).toString());
			this.item_title = OActivity.getProperty(XML_ITEM_TITLE).toString();
			this.expired = Integer.parseInt(OActivity.getProperty(XML_EXPIRED)
					.toString());
			this.total_bidder = Integer.parseInt(OActivity.getProperty(
					XML_TOTAL_BIDDER).toString());
			if (OActivity.hasProperty(XML_MAX_BUDGET)) {
				this.max_budget = OActivity.getProperty(
						XML_MAX_BUDGET).toString();
			} else
				this.max_budget = "0";
			this.description = OActivity.getProperty(XML_DESCRIPTION)
					.toString();
			this.imgLink = OActivity.getProperty(XML_IMG_LINK).toString();
			this.price = Integer.parseInt(OActivity.getProperty(
					XML_ACTIVITY_PRICE).toString());
			this.your = Integer.parseInt(OActivity.getProperty(XML_YOUR_PRICE)
					.toString());
			this.category_id = Integer.parseInt(OActivity.getProperty(
					XML_CATEGORY_ID).toString());
			this.status = Integer.parseInt(OActivity.getProperty(XML_STATUS)
					.toString());
		}
	}

	public int getItemID() {
		return this.item_id;
	}

	public void setCategoryId(int id) {
		this.category_id = id;
	}

	public int getActivityID() {
		return this.activity_id;
	}

	public String getItemTitle() {
		return this.item_title;
	}

	public int getEXP() {
		return this.expired;
	}

	public int getTotalBidder() {
		return this.total_bidder;
	}

	public String getMaxBudget() {
		return this.max_budget;
	}

	public int getActivityPrice() {
		return this.price;
	}

	public int getYour() {
		return this.your;
	}

	public String getDesc() {
		return this.description;
	}

	public String getIMG() {
		return this.imgLink;
	}

	public int getActivityStatus() {
		return this.status;
	}

	public void setActivityStatus(int status) {
		this.status = status;
	}

	public void setItemID(int id) {
		this.item_id = id;
	}

	public int getCategoryId() {
		return this.category_id;
	}

	public void setActivityID(int id) {
		this.activity_id = id;
	}

	public void setItemTitle(String title) {
		this.item_title = title;
	}

	public void setEXP(int exp) {
		this.expired = exp;
	}

	public void setTotalBidder(int total) {
		this.total_bidder = total;
	}

	public void setMaxBudget(String max) {
		this.max_budget = max;
	}

	public void setActivityPrice(int price) {
		this.price = price;
	}

	public void setYour(int your) {
		this.your = your;
	}

	public void setDesc(String desc) {
		this.description = desc;
	}

	public void setIMG(String img) {
		this.imgLink = img;
	}
}
